(function(){
	'use strict';
	angular.module('controllers.omdisplay.businessOperation',[])
	.controller('mainOperationController',mainOperationController);
	function mainOperationController($scope,CoreService){
		var spans = ['/accuracy','/integrityAnalysis'];
		$scope.selectedIndex = CoreService.navgit(spans);
		$scope.$on('$stateChangeSuccess', function(evt, state) {
      $scope.selectedIndex = spans.indexOf(state.url);
    });
		$scope._changeDataState=function (name,dataAll,responseName){
			var data = [];
			for(var i=0;name.length>i;i++){
				var perData = {responseName:'',data:[]};
				perData.responseName = name[i];
				perData.data = dataAll.filter(function(v){
					return v[responseName] === name[i];
				});
				data.push(perData);
			}
			return {name:name,data:data};
		}

	}
})();